/**
 * Created by Dalyn on 2017/3/16.
 */
import Relay from "react-relay";

export default class RoleDetailMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { roleDetail }`;
    }

    getVariables() {
        return {
            argsInput: {
                rid:this.props.rid
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on roleDetailPayload {
            roleDetail {  
                errorCode
                value
                totalResult
                id
                role{
                    rid
                    name
                    description
                    pid
                }
                permissionList{
                    pid
                    name
                    enName
                    description
                    modulesName
                }
                roleModelList{
                    pid
                    name
                    count
                    rid
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on roleDetailPayload {
                    roleDetail {  
                        errorCode
                        value
                        totalResult
                        id
                        role{
                            rid
                            name
                            description
                            pid
                        }
                        permissionList{
                            pid
                            name
                            enName
                            description
                            modulesName
                        }
                        roleModelList{
                            pid
                            name
                            count
                            rid
                        }
                    }
                }
            `]
        }];
    }
}